<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
	<title>木投网--个人中心--采购单管理</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_user.css">
	<link rel="stylesheet" href="/resource/css/mt_showBo.css">
</head>
<body>
@include("common.shop_user_head")
		<div class="user-cont left">
			<div class="user-title">采购单管理</div>
			<div class="resource">
				<!-- 采购单管理 -->
				<div class="table">
					<table>
						<thead>
							<tr>
								<th width="125px">商品标题</th>
								<th width="130px">规格</th>
								<th width="130px">数量</th>
								<th width="150px">价格</th>
								<th width="130px">发布时间</th>
								<th width="95px">状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
						@foreach($data as $data1)
							<tr>
								<td>{{$data1->title}}</td>
								<td>{{$data1->spec}}</td>
								<td>{{$data1->num}}{{$data1->unit}}</td>
								<td><span>￥{{$data1->price}}/{{$data1->unit}}</span></td>
								<td>{{date('Y-m-d H:i:s', $data1->created);}}</td>
								<td style="color:#f08300;">
									@if($data1->state==1)
									已通过
									@else
									未通过
									@endif
								</td>
								<td><a   onClick="javascript:confirm('你确定要删除?')" href="/user_purchase_resource_del?purchase_id={{$data1->purchase_id}}">删除</a></td>
								<input type="hidden" id="purchase_id" value="{{$data1->purchase_id}}">
							</tr>
						@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
		@include("common.shop_user_foot")
<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script src="/resource/js/mt_showBo.js"></script>  <!-- 提示信息 -->
<script>
	//点击删除
//	$('.resource .table td a').click(function(){
//		Showbo.Msg.confirm('<img class="left" src="/resource/img/user_if.png" alt=""><span style="float:left;font-size:22px;">确定删除该采购单？</span>',function(btn){
//			if (btn == 'yes') {
//				console.log('确定');
//				var purchase_id = $('#purchase_id').val();
//				$.ajax({
//					url : '/user_purchase_resource_del',
//					type : "POST",
//					data : {purchase_id:purchase_id},
//					dataType : "json",
//					cache:"false",
//					timeout:30000,
//					success : function(json) {
//						if(json.code >= 1){
//							Showbo.Msg.alert('<img src="/resource/img/popup_success.png" alt=""><br/>删除成功');
//						}
//					}
//				});
//			}else{
//				return false;
//			};
//		});
//	});
</script>
</body>
</html>